﻿using System;
using System.Globalization;
using System.Text;
using System.Windows.Data;

namespace Poet.Converters
{
    class EncodingToBooleanConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            var encodingInfo = values[0] as EncodingInfo;
            var encoding = values[1] as Encoding;
            if(encoding == null || encodingInfo == null) return false;
            return Equals(encoding, encodingInfo.GetEncoding());
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
